<?php
class C_Index extends C_Abstract
{
    public function indexAction()
    {
        require_once MODULE_PATH .'/cms/link.php';
        $data_tmp = \Modules\Cms\Link::fetch('home');
        $data = array();
        foreach ($data_tmp as $row) {
            $data[$row['idx']][] = $row;
        }
        $news = \Modules\Cms\Link::fetch('news', 'news', 6);
        
        // 算出recommend的总宽度
        $rc = count($data['recommend']) * '305';
        
        $this->smt->assign('data', $data);
        $this->smt->assign('news', $news);
        $this->smt->assign('rc', $rc);
        $this->smt->display('index.html');
    }
}